package com.itany.boot.service;

import com.github.pagehelper.PageInfo;
import com.itany.boot.entity.Resource;
import com.itany.boot.exception.RequestParameterErrorException;

import javax.servlet.http.HttpServletResponse;

/**
 * @author 黄衡熙
 * @version 1.0
 */
public interface ResourceService {
    /**
     * 分页查询
     * @param resourceParam
     * @param pageNo
     * @param pageSize
     * @return
     */
    PageInfo<Resource> findByParams(Resource resourceParam, String pageNo, String pageSize);

    /**
     * 启用与禁用
     * @param id
     * @param status
     * @throws RequestParameterErrorException
     */
    void modifyStatus(String id,String status) throws RequestParameterErrorException;

    /**
     * 根据id查询资源
     * @param id
     * @return
     */
    Resource findById(String id);
    /**
     * 下载资源文件
     * @param id
     * @param response
     */
    void downloadResource(String id, HttpServletResponse response) throws Exception;
}
